home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / EPPC.h < prev    next >
Text File  |  1991-04-17  |  3KB  |  132 lines

  1. /************************************************************
  2.  
  3. Created: Sunday, January 6, 1991 at 9:10 PM
  4.     EPPC.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1988-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __EPPC__
  15. #define __EPPC__
  16.  
  17. #ifndef __PPCTOOLBOX__
  18. #include <PPCToolbox.h>
  19. #endif
  20.  
  21. #ifndef __PROCESSES__
  22. #include <Processes.h>
  23. #endif
  24.  
  25. #ifndef __EVENTS__
  26. #include <Events.h>
  27. #endif
  28.  
  29.  
  30. enum {
  31.  
  32.     kHighLevelEvent = 23,
  33.  
  34. /* postOptions currently supported */
  35.     receiverIDMask = 0x0000F000,
  36.     receiverIDisPSN = 0x00008000,
  37.     receiverIDisSignature = 0x00007000,
  38.     receiverIDisSessionID = 0x00006000,
  39.     receiverIDisTargetID = 0x00005000,
  40.  
  41.     systemOptionsMask = 0x00000F00,
  42.     nReturnReceipt = 0x00000200,
  43.  
  44.     priorityMask = 0x000000FF,
  45.     nAttnMsg = 0x00000001,
  46.  
  47.  
  48. /* error returns from Post and Accept */
  49.  
  50.     bufferIsSmall = -607,
  51.     noOutstandingHLE = -608,
  52.     connectionInvalid = -609,
  53.     noUserInteractionAllowed = -610,    /* no user interaction allowed */
  54.  
  55. /* constant for return receipts */
  56.  
  57.  
  58. #define HighLevelEventMsgClass 'jaym'
  59. #define rtrnReceiptMsgID 'rtrn'
  60.  
  61.     msgWasPartiallyAccepted = 2,
  62.     msgWasFullyAccepted = 1,
  63.     msgWasNotAccepted = 0
  64. };
  65.  
  66. struct TargetID {
  67.     long sessionID;
  68.     PPCPortRec name;
  69.     LocationNameRec location;
  70.     PPCPortRec recvrName;
  71. };
  72.  
  73. typedef struct TargetID TargetID;
  74. typedef TargetID *TargetIDPtr, **TargetIDHdl;
  75.  
  76.  
  77. typedef TargetID SenderID;
  78. typedef SenderID *SenderIDPtr;
  79.  
  80. struct HighLevelEventMsg {
  81.     unsigned short HighLevelEventMsgHeaderLength;
  82.     unsigned short version;
  83.     unsigned long reserved1;
  84.     EventRecord theMsgEvent;
  85.     unsigned long userRefcon;
  86.     unsigned long postingOptions;
  87.     unsigned long msgLength;
  88. };
  89.  
  90. typedef struct HighLevelEventMsg HighLevelEventMsg;
  91. typedef HighLevelEventMsg *HighLevelEventMsgPtr, **HighLevelEventMsgHdl;
  92.  
  93.  
  94. #ifdef __cplusplus
  95. extern "C" {
  96. #endif
  97. pascal OSErr PostHighLevelEvent(const EventRecord *theEvent,
  98.                                 unsigned long receiverID,
  99.                                 unsigned long msgRefcon,
  100.                                 Ptr msgBuff,
  101.                                 unsigned long msgLen,
  102.                                 unsigned long postingOptions)
  103.     = {0x3F3C,0x0034,0xA88F}; 
  104. pascal OSErr AcceptHighLevelEvent(TargetID *sender,
  105.                                   unsigned long *msgRefcon,
  106.                                   Ptr msgBuff,
  107.                                   unsigned long *msgLen)
  108.     = {0x3F3C,0x0033,0xA88F}; 
  109. pascal OSErr GetProcessSerialNumberFromPortName(const PPCPortPtr portName,
  110.     ProcessSerialNumberPtr pPSN)
  111.     = {0x3F3C,0x0035,0xA88F}; 
  112. pascal OSErr GetPortNameFromProcessSerialNumber(PPCPortPtr portName,const ProcessSerialNumberPtr pPSN)
  113.     = {0x3F3C,0x0046,0xA88F}; 
  114. #ifdef __cplusplus
  115. }
  116. #endif
  117. typedef pascal Boolean (*GetSpecificFilterProcPtr) (void *yourDataPtr,
  118.      HighLevelEventMsgPtr msgBuff,
  119.      const TargetID *sender);
  120.  
  121. #ifdef __cplusplus
  122. extern "C" {
  123. #endif
  124. pascal Boolean GetSpecificHighLevelEvent(GetSpecificFilterProcPtr aFilter,
  125.     void *yourDataPtr,OSErr *err)
  126.     = {0x3F3C,0x0045,0xA88F}; 
  127. #ifdef __cplusplus
  128. }
  129. #endif
  130.  
  131. #endif
  132.